import request from '@/utils/request'

// 查询参数列表
export function getList(query) {
  return request({
    url: '/online/dblink/page',
    method: 'get',
    headers: {
      isToken: true,
    },
    params: query
  })
}

// 添加
export function addData(data) {
  return request({
    url: '/online/dblink',
    headers: {
      isToken: true,
    },
    method: 'post',
    data
  })
}

//编辑
export function editData(data){
  return request({
    url: '/online/dblink',
    headers: {
      isToken: true,
    },
    method: 'put',
    data
  })
}

//编辑
export function delData(id){
  return request({
    url: '/online/dblink/'+id,
    headers: {
      isToken: true,
    },
    method: 'delete',
  })
}


//连接数据库
export function connectDatabaseData(dblinkId){
  return request({
    url:"/online/dblink/testConnection",
    headers: {
      isToken: true,
    },
    method: 'get',
    params:{
      dblinkId
    }
  })
}
